/**
 * Copyright(C) 2008 Matthias Braunhofer
 * All rights reserved
 *
 * Created on: 23.08.2008
 */

package it.cums.core.util;

public class DBConfiguration {
	private static String[] dbms = {"MySQL", "PostgreSQL"};
	private static String[] drivers = {"org.gjt.mm.mysql.Driver", "org.postgresql.Driver"};
	private static String[] dialects = {"org.hibernate.dialect.MySQLDialect", "org.hibernate.dialect.PostgreSQLDialect"};
	
	public static String getDriver(String database) {
		for (int i = 0; i < dbms.length; i++) {
			if (dbms[i].equals(database)) {
				return drivers[i];
			}
		}
		return null;				   
	}
	
	public static String getDialect(String database) {
		for (int i = 0; i < dbms.length; i++) {
			if (dbms[i].equals(database)) {
				return dialects[i];
			}
		}
		return null;	
	}
}
